from flask import Blueprint, render_template

from service.ArticleService import get_about_by_group_id_is_about, get_article_content

view_about = Blueprint('view_about', __name__)
view_about.url_prefix = '/view/about'


@view_about.route('')
def index():
    article = get_about_by_group_id_is_about()
    if article is None:
        return "error"
    article.content = get_article_content(article)
    return render_template('public/style1/about.html', article=article)
